

type JoystickID = number;

const HAT_CENTERED = 0x00
const HAT_UP = 0x01
const HAT_RIGHT = 0x02
const HAT_DOWN = 0x04
const HAT_LEFT = 0x08
const HAT_RIGHTUP = (HAT_RIGHT|HAT_UP)
const HAT_RIGHTDOWN = (HAT_RIGHT|HAT_DOWN)
const HAT_LEFTUP = (HAT_LEFT|HAT_UP)
const HAT_LEFTDOWN = (HAT_LEFT|HAT_DOWN)

enum JoystickType
{
    JOYSTICK_TYPE_UNKNOWN,
    JOYSTICK_TYPE_GAMECONTROLLER,
    JOYSTICK_TYPE_WHEEL,
    JOYSTICK_TYPE_ARCADE_STICK,
    JOYSTICK_TYPE_FLIGHT_STICK,
    JOYSTICK_TYPE_DANCE_PAD,
    JOYSTICK_TYPE_GUITAR,
    JOYSTICK_TYPE_DRUM_KIT,
    JOYSTICK_TYPE_ARCADE_PAD,
    JOYSTICK_TYPE_THROTTLE
}

enum JoystickPowerLevel
{
    JOYSTICK_POWER_UNKNOWN = -1,
    JOYSTICK_POWER_EMPTY,   /* <= 5% */
    JOYSTICK_POWER_LOW,     /* <= 20% */
    JOYSTICK_POWER_MEDIUM,  /* <= 70% */
    JOYSTICK_POWER_FULL,    /* <= 100% */
    JOYSTICK_POWER_WIRED,
    JOYSTICK_POWER_MAX
}
